
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<?php
include('../resource/menu.php');
include('../resource/config.php'); 
if (isset($_GET['LOUS']) ) { 
$LOUS = $_GET['LOUS']; 
if (isset($_POST['submitted'])) { 
foreach($_POST AS $key => $value) { $_POST[$key] = mysql_real_escape_string($value); } 
$sql = "UPDATE `regusu` SET  `LOUS` =  '{$_POST['LOUS']}' ,  `NAUS` =  '{$_POST['NAUS']}' ,  `PASS` =  '{$_POST['PASS']}'   WHERE `LOUS` = '$LOUS' "; 
mysql_query($sql) or die(mysql_error()); 
echo (mysql_affected_rows()) ? "<div class='span4'>
      <div class='alert alert-success'>
        <a class='close'>×</a>
        <strong>Actualizado</strong> Se ha actualizado correctamente la informacion.<br><a href='listar.php'>Volver a la lista</a>
      </div>
    </div>" : "<div class='span4'>
      <div class='alert alert-error'>
        <a class='close'>×</a>
        <strong>Ops</strong> No se logro actualizar la informacion.<br><a href='listar.php'>Volver a la lista</a>
      </div>
    </div>"; 
} 
$row = mysql_fetch_array ( mysql_query("SELECT * FROM `regusu` WHERE `LOUS` = '$LOUS' ")); 
?>


<html>
	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		
        <link href="../resource/responsive/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="../resource/responsive/bootstrap-responsive.min.css" rel="stylesheet">
        <script src="../resource/responsive/jquery.min.js"></script>
        <script src="../resource/responsive/bootstrap.min.js"></script>
        <!--    FORMATO DE TABLAS    -->
        <link href="../resource/table/demo_table.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" language="javascript" src="../resource/table/jquery.dataTables.js"></script>
        <!--    FORMATO DE TABLAS    -->

	</head>
<body>
 	<div id="navbar"></div>

<div class="span9">
	<div class="hero-unit">
		<form action='' method='POST'> 
		<p><b>Usuario:</b><br /><input type='text' name='LOUS' value='<?php echo $row['LOUS'] ?>' /> 
		<p><b>Nombre:</b><br /><input type='text' name='NAUS' value='<?php echo $row['NAUS'] ?>' /> 
		<p><b>Clave:</b><br /><input type='password' name='PASS' value='<?php echo $row['PASS'] ?>' /> 
		<p><input type='submit' value='Actualizar' class="btn btn-primary"/><input type='hidden' value='1' name='submitted' /> 
		</form> 
	</div>
</div>
<?php } ?> 

</body>
</html>
